// Copyright (c) 2018-present Baidu, Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "mysql_err_handler.h"
#include "mysql_err_code.h"

namespace baikaldb {

bool MysqlErrHandler::init() {
    if (_is_init) {
        return true;
    }
    // gcc82的bug:加-O2 -g后编译太慢，放在头文件需要几小时，在函数内也需要2分钟
    static std::vector<MysqlErrorItem> mysql_err_item = {
        { ER_HASHCHK, "ER_HASHCHK", "", "" },
        { ER_NISAMCHK, "ER_NISAMCHK", "", "" },
        { ER_NO, "ER_NO", "", "" },
        { ER_YES, "ER_YES", "", "" },
        { ER_CANT_CREATE_FILE, "ER_CANT_CREATE_FILE", "", "" },
        { ER_CANT_CREATE_TABLE, "ER_CANT_CREATE_TABLE", "", "" },
        { ER_CANT_CREATE_DB, "ER_CANT_CREATE_DB", "", "" },
        { ER_DB_CREATE_EXISTS, "ER_DB_CREATE_EXISTS", "", "" },
        { ER_DB_DROP_EXISTS, "ER_DB_DROP_EXISTS", "", "" },
        { ER_DB_DROP_DELETE, "ER_DB_DROP_DELETE", "", "" },
        { ER_DB_DROP_RMDIR, "ER_DB_DROP_RMDIR", "", "" },
        { ER_CANT_DELETE_FILE, "ER_CANT_DELETE_FILE", "", "" },
        { ER_CANT_FIND_SYSTEM_REC, "ER_CANT_FIND_SYSTEM_REC", "", "" },
        { ER_CANT_GET_STAT, "ER_CANT_GET_STAT", "", "" },
        { ER_CANT_GET_WD, "ER_CANT_GET_WD", "", "" },
        { ER_CANT_LOCK, "ER_CANT_LOCK", "", "" },
        { ER_CANT_OPEN_FILE, "ER_CANT_OPEN_FILE", "", "" },
        { ER_FILE_NOT_FOUND, "ER_FILE_NOT_FOUND", "", "" },
        { ER_CANT_READ_DIR, "ER_CANT_READ_DIR", "", "" },
        { ER_CANT_SET_WD, "ER_CANT_SET_WD", "", "" },
        { ER_CHECKREAD, "ER_CHECKREAD", "", "" },
        { ER_DISK_FULL, "ER_DISK_FULL", "", "" },
        { ER_DUP_KEY, "ER_DUP_KEY", "", "" },
        { ER_ERROR_ON_CLOSE, "ER_ERROR_ON_CLOSE", "", "" },
        { ER_ERROR_ON_READ, "ER_ERROR_ON_READ", "", "" },
        { ER_ERROR_ON_RENAME, "ER_ERROR_ON_RENAME", "", "" },
        { ER_ERROR_ON_WRITE, "ER_ERROR_ON_WRITE", "", "" },
        { ER_FILE_USED, "ER_FILE_USED", "", "" },
        { ER_FILSORT_ABORT, "ER_FILSORT_ABORT", "", "" },
        { ER_FORM_NOT_FOUND, "ER_FORM_NOT_FOUND", "", "" },
        { ER_GET_ERRNO, "ER_GET_ERRNO", "", "" },
        { ER_ILLEGAL_HA, "ER_ILLEGAL_HA", "", "" },
        { ER_KEY_NOT_FOUND, "ER_KEY_NOT_FOUND", "", "" },
        { ER_NOT_FORM_FILE, "ER_NOT_FORM_FILE", "", "" },
        { ER_NOT_KEYFILE, "ER_NOT_KEYFILE", "", "" },
        { ER_OLD_KEYFILE, "ER_OLD_KEYFILE", "", "" },
        { ER_OPEN_AS_READONLY, "ER_OPEN_AS_READONLY", "", "" },
        { ER_OUTOFMEMORY, "ER_OUTOFMEMORY", "", "" },
        { ER_OUT_OF_SORTMEMORY, "ER_OUT_OF_SORTMEMORY", "HY001", "S1001" },
        { ER_UNEXPECTED_EOF, "ER_UNEXPECTED_EOF", "", "" },
        { ER_CON_COUNT_ERROR, "ER_CON_COUNT_ERROR", "08004", "" },
        { ER_OUT_OF_RESOURCES, "ER_OUT_OF_RESOURCES", "", "" },
        { ER_BAD_HOST_ERROR, "ER_BAD_HOST_ERROR", "08S01", "" },
        { ER_HANDSHAKE_ERROR, "ER_HANDSHAKE_ERROR", "08S01", "" },
        { ER_DBACCESS_DENIED_ERROR, "ER_DBACCESS_DENIED_ERROR", "42000", "" },
        { ER_ACCESS_DENIED_ERROR, "ER_ACCESS_DENIED_ERROR", "28000", "" },
        { ER_NO_DB_ERROR, "ER_NO_DB_ERROR", "3D000", "" },
        { ER_UNKNOWN_COM_ERROR, "ER_UNKNOWN_COM_ERROR", "08S01", "" },
        { ER_BAD_NULL_ERROR, "ER_BAD_NULL_ERROR", "23000", "" },
        { ER_BAD_DB_ERROR, "ER_BAD_DB_ERROR", "42000", "" },
        { ER_TABLE_EXISTS_ERROR, "ER_TABLE_EXISTS_ERROR", "42S01", "" },
        { ER_BAD_TABLE_ERROR, "ER_BAD_TABLE_ERROR", "42S02", "" },
        { ER_NON_UNIQ_ERROR, "ER_NON_UNIQ_ERROR", "23000", "" },
        { ER_SERVER_SHUTDOWN, "ER_SERVER_SHUTDOWN", "08S01", "" },
        { ER_BAD_FIELD_ERROR, "ER_BAD_FIELD_ERROR", "42S22", "S0022" },
        { ER_WRONG_FIELD_WITH_GROUP, "ER_WRONG_FIELD_WITH_GROUP", "42000", "S1009" },
        { ER_WRONG_GROUP_FIELD, "ER_WRONG_GROUP_FIELD", "42000", "S1009" },
        { ER_WRONG_SUM_SELECT, "ER_WRONG_SUM_SELECT", "42000", "S1009" },
        { ER_WRONG_VALUE_COUNT, "ER_WRONG_VALUE_COUNT", "21S01", "" },
        { ER_TOO_LONG_IDENT, "ER_TOO_LONG_IDENT", "42000", "S1009" },
        { ER_DUP_FIELDNAME, "ER_DUP_FIELDNAME", "42S21", "S1009" },
        { ER_DUP_KEYNAME, "ER_DUP_KEYNAME", "42000", "S1009" },
        { ER_DUP_ENTRY, "ER_DUP_ENTRY", "23000", "S1009" },
        { ER_WRONG_FIELD_SPEC, "ER_WRONG_FIELD_SPEC", "42000", "S1009" },
        { ER_PARSE_ERROR, "ER_PARSE_ERROR", "42000", "s1009" },
        { ER_EMPTY_QUERY, "ER_EMPTY_QUERY", "42000", "" },
        { ER_NONUNIQ_TABLE, "ER_NONUNIQ_TABLE", "42000", "S1009" },
        { ER_INVALID_DEFAULT, "ER_INVALID_DEFAULT", "42000", "S1009" },
        { ER_MULTIPLE_PRI_KEY, "ER_MULTIPLE_PRI_KEY", "42000", "S1009" },
        { ER_TOO_MANY_KEYS, "ER_TOO_MANY_KEYS", "42000", "S1009" },
        { ER_TOO_MANY_KEY_PARTS, "ER_TOO_MANY_KEY_PARTS", "42000", "S1009" },
        { ER_TOO_LONG_KEY, "ER_TOO_LONG_KEY", "42000", "S1009" },
        { ER_KEY_COLUMN_DOES_NOT_EXITS, "ER_KEY_COLUMN_DOES_NOT_EXITS", "42000", "S1009" },
        { ER_BLOB_USED_AS_KEY, "ER_BLOB_USED_AS_KEY", "42000", "S1009" },
        { ER_TOO_BIG_FIELDLENGTH, "ER_TOO_BIG_FIELDLENGTH", "42000", "S1009" },
        { ER_WRONG_AUTO_KEY, "ER_WRONG_AUTO_KEY", "42000", "S1009" },
        { ER_READY, "ER_READY", "", "" },
        { ER_NORMAL_SHUTDOWN, "ER_NORMAL_SHUTDOWN", "", "" },
        { ER_GOT_SIGNAL, "ER_GOT_SIGNAL", "", "" },
        { ER_SHUTDOWN_COMPLETE, "ER_SHUTDOWN_COMPLETE", "", "" },
        { ER_FORCING_CLOSE, "ER_FORCING_CLOSE", "08S01", "" },
        { ER_IPSOCK_ERROR, "ER_IPSOCK_ERROR", "08S01", "" },
        { ER_NO_SUCH_INDEX, "ER_NO_SUCH_INDEX", "42S12", "S1009" },
        { ER_WRONG_FIELD_TERMINATORS, "ER_WRONG_FIELD_TERMINATORS", "42000", "S1009" },
        { ER_BLOBS_AND_NO_TERMINATED, "ER_BLOBS_AND_NO_TERMINATED", "42000", "S1009" },
        { ER_TEXTFILE_NOT_READABLE, "ER_TEXTFILE_NOT_READABLE", "", "" },
        { ER_FILE_EXISTS_ERROR, "ER_FILE_EXISTS_ERROR", "", "" },
        { ER_LOAD_INFO, "ER_LOAD_INFO", "", "" },
        { ER_ALTER_INFO, "ER_ALTER_INFO", "", "" },
        { ER_WRONG_SUB_KEY, "ER_WRONG_SUB_KEY", "", "" },
        { ER_CANT_REMOVE_ALL_FIELDS, "ER_CANT_REMOVE_ALL_FIELDS", "42000", "" },
        { ER_CANT_DROP_FIELD_OR_KEY, "ER_CANT_DROP_FIELD_OR_KEY", "42000", "" },
        { ER_INSERT_INFO, "ER_INSERT_INFO", "", "" },
        { ER_UPDATE_TABLE_USED, "ER_UPDATE_TABLE_USED", "", "" },
        { ER_NO_SUCH_THREAD, "ER_NO_SUCH_THREAD", "", "" },
        { ER_KILL_DENIED_ERROR, "ER_KILL_DENIED_ERROR", "", "" },
        { ER_NO_TABLES_USED, "ER_NO_TABLES_USED", "", "" },
        { ER_TOO_BIG_SET, "ER_TOO_BIG_SET", "", "" },
        { ER_NO_UNIQUE_LOGFILE, "ER_NO_UNIQUE_LOGFILE", "", "" },
        { ER_TABLE_NOT_LOCKED_FOR_WRITE, "ER_TABLE_NOT_LOCKED_FOR_WRITE", "", "" },
        { ER_TABLE_NOT_LOCKED, "ER_TABLE_NOT_LOCKED", "", "" },
        { ER_BLOB_CANT_HAVE_DEFAULT, "ER_BLOB_CANT_HAVE_DEFAULT", "42000", "" },
        { ER_WRONG_DB_NAME, "ER_WRONG_DB_NAME", "42000", "" },
        { ER_WRONG_TABLE_NAME, "ER_WRONG_TABLE_NAME", "42000", "" },
        { ER_TOO_BIG_SELECT, "ER_TOO_BIG_SELECT", "42000", "" },
        { ER_UNKNOWN_ERROR, "ER_UNKNOWN_ERROR", "", "" },
        { ER_UNKNOWN_PROCEDURE, "ER_UNKNOWN_PROCEDURE", "42000", "" },
        { ER_WRONG_PARAMCOUNT_TO_PROCEDURE, "ER_WRONG_PARAMCOUNT_TO_PROCEDURE", "42000", "" },
        { ER_WRONG_PARAMETERS_TO_PROCEDURE, "ER_WRONG_PARAMETERS_TO_PROCEDURE", "", "" },
        { ER_UNKNOWN_TABLE, "ER_UNKNOWN_TABLE", "42S02", "" },
        { ER_FIELD_SPECIFIED_TWICE, "ER_FIELD_SPECIFIED_TWICE", "42000", "" },
        { ER_INVALID_GROUP_FUNC_USE, "ER_INVALID_GROUP_FUNC_USE", "", "" },
        { ER_UNSUPPORTED_EXTENSION, "ER_UNSUPPORTED_EXTENSION", "42000", "" },
        { ER_TABLE_MUST_HAVE_COLUMNS, "ER_TABLE_MUST_HAVE_COLUMNS", "42000", "" },
        { ER_RECORD_FILE_FULL, "ER_RECORD_FILE_FULL", "", "" },
        { ER_UNKNOWN_CHARACTER_SET, "ER_UNKNOWN_CHARACTER_SET", "42000", "" },
        { ER_TOO_MANY_TABLES, "ER_TOO_MANY_TABLES", "", "" },
        { ER_TOO_MANY_FIELDS, "ER_TOO_MANY_FIELDS", "", "" },
        { ER_TOO_BIG_ROWSIZE, "ER_TOO_BIG_ROWSIZE", "42000", "" },
        { ER_STACK_OVERRUN, "ER_STACK_OVERRUN", "", "" },
        { ER_WRONG_OUTER_JOIN, "ER_WRONG_OUTER_JOIN", "42000", "" },
        { ER_NULL_COLUMN_IN_INDEX, "ER_NULL_COLUMN_IN_INDEX", "42000", "" },
        { ER_CANT_FIND_UDF, "ER_CANT_FIND_UDF", "", "" },
        { ER_CANT_INITIALIZE_UDF, "ER_CANT_INITIALIZE_UDF", "", "" },
        { ER_UDF_NO_PATHS, "ER_UDF_NO_PATHS", "", "" },
        { ER_UDF_EXISTS, "ER_UDF_EXISTS", "", "" },
        { ER_CANT_OPEN_LIBRARY, "ER_CANT_OPEN_LIBRARY", "", "" },
        { ER_CANT_FIND_DL_ENTRY, "ER_CANT_FIND_DL_ENTRY", "", "" },
        { ER_FUNCTION_NOT_DEFINED, "ER_FUNCTION_NOT_DEFINED", "", "" },
        { ER_HOST_IS_BLOCKED, "ER_HOST_IS_BLOCKED", "", "" },
        { ER_HOST_NOT_PRIVILEGED, "ER_HOST_NOT_PRIVILEGED", "", "" },
        { ER_PASSWORD_ANONYMOUS_USER, "ER_PASSWORD_ANONYMOUS_USER", "42000", "" },
        { ER_PASSWORD_NOT_ALLOWED, "ER_PASSWORD_NOT_ALLOWED", "42000", "" },
        { ER_PASSWORD_NO_MATCH, "ER_PASSWORD_NO_MATCH", "42000", "" },
        { ER_UPDATE_INFO, "ER_UPDATE_INFO", "", "" },
        { ER_CANT_CREATE_THREAD, "ER_CANT_CREATE_THREAD", "", "" },
        { ER_WRONG_VALUE_COUNT_ON_ROW, "ER_WRONG_VALUE_COUNT_ON_ROW", "21S01", "" },
        { ER_CANT_REOPEN_TABLE, "ER_CANT_REOPEN_TABLE", "", "" },
        { ER_INVALID_USE_OF_NULL, "ER_INVALID_USE_OF_NULL", "22004", "" },
        { ER_REGEXP_ERROR, "ER_REGEXP_ERROR", "42000", "" },
        { ER_MIX_OF_GROUP_FUNC_AND_FIELDS, "ER_MIX_OF_GROUP_FUNC_AND_FIELDS", "42000", "" },
        { ER_NONEXISTING_GRANT, "ER_NONEXISTING_GRANT", "42000", "" },
        { ER_TABLEACCESS_DENIED_ERROR, "ER_TABLEACCESS_DENIED_ERROR", "42000", "" },
        { ER_COLUMNACCESS_DENIED_ERROR, "ER_COLUMNACCESS_DENIED_ERROR", "42000", "" },
        { ER_ILLEGAL_GRANT_FOR_TABLE, "ER_ILLEGAL_GRANT_FOR_TABLE", "42000", "" },
        { ER_GRANT_WRONG_HOST_OR_USER, "ER_GRANT_WRONG_HOST_OR_USER", "42000", "" },
        { ER_NO_SUCH_TABLE, "ER_NO_SUCH_TABLE", "42S02", "" },
        { ER_NONEXISTING_TABLE_GRANT, "ER_NONEXISTING_TABLE_GRANT", "42000", "" },
        { ER_NOT_ALLOWED_COMMAND, "ER_NOT_ALLOWED_COMMAND", "42000", "" },
        { ER_SYNTAX_ERROR, "ER_SYNTAX_ERROR", "42000", "" },
        { ER_DELAYED_CANT_CHANGE_LOCK, "ER_DELAYED_CANT_CHANGE_LOCK", "", "" },
        { ER_TOO_MANY_DELAYED_THREADS, "ER_TOO_MANY_DELAYED_THREADS", "", "" },
        { ER_ABORTING_CONNECTION, "ER_ABORTING_CONNECTION", "08S01", "" },
        { ER_NET_PACKET_TOO_LARGE, "ER_NET_PACKET_TOO_LARGE", "08S01", "" },
        { ER_NET_READ_ERROR_FROM_PIPE, "ER_NET_READ_ERROR_FROM_PIPE", "08S01", "" },
        { ER_NET_FCNTL_ERROR, "ER_NET_FCNTL_ERROR", "08S01", "" },
        { ER_NET_PACKETS_OUT_OF_ORDER, "ER_NET_PACKETS_OUT_OF_ORDER", "08S01", "" },
        { ER_NET_UNCOMPRESS_ERROR, "ER_NET_UNCOMPRESS_ERROR", "08S01", "" },
        { ER_NET_READ_ERROR, "ER_NET_READ_ERROR", "08S01", "" },
        { ER_NET_READ_INTERRUPTED, "ER_NET_READ_INTERRUPTED", "08S01", "" },
        { ER_NET_ERROR_ON_WRITE, "ER_NET_ERROR_ON_WRITE", "08S01", "" },
        { ER_NET_WRITE_INTERRUPTED, "ER_NET_WRITE_INTERRUPTED", "08S01", "" },
        { ER_TOO_LONG_STRING, "ER_TOO_LONG_STRING", "42000", "" },
        { ER_TABLE_CANT_HANDLE_BLOB, "ER_TABLE_CANT_HANDLE_BLOB", "42000", "" },
        { ER_TABLE_CANT_HANDLE_AUTO_INCREMENT, "ER_TABLE_CANT_HANDLE_AUTO_INCREMENT", "42000", "" },
        { ER_DELAYED_INSERT_TABLE_LOCKED, "ER_DELAYED_INSERT_TABLE_LOCKED", "", "" },
        { ER_WRONG_COLUMN_NAME, "ER_WRONG_COLUMN_NAME", "42000", "" },
        { ER_WRONG_KEY_COLUMN, "ER_WRONG_KEY_COLUMN", "42000", "" },
        { ER_WRONG_MRG_TABLE, "ER_WRONG_MRG_TABLE", "", "" },
        { ER_DUP_UNIQUE, "ER_DUP_UNIQUE", "23000", "" },
        { ER_BLOB_KEY_WITHOUT_LENGTH, "ER_BLOB_KEY_WITHOUT_LENGTH", "42000", "" },
        { ER_PRIMARY_CANT_HAVE_NULL, "ER_PRIMARY_CANT_HAVE_NULL", "42000", "" },
        { ER_TOO_MANY_ROWS, "ER_TOO_MANY_ROWS", "42000", "" },
        { ER_REQUIRES_PRIMARY_KEY, "ER_REQUIRES_PRIMARY_KEY", "42000", "" },
        { ER_NO_RAID_COMPILED, "ER_NO_RAID_COMPILED", "", "" },
        { ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE, "ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE", "", "" },
        { ER_KEY_DOES_NOT_EXITS, "ER_KEY_DOES_NOT_EXITS", "42000", "S1009" },
        { ER_CHECK_NO_SUCH_TABLE, "ER_CHECK_NO_SUCH_TABLE", "42000", "" },
        { ER_CHECK_NOT_IMPLEMENTED, "ER_CHECK_NOT_IMPLEMENTED", "42000", "" },
        { ER_CANT_DO_THIS_DURING_AN_TRANSACTION, "ER_CANT_DO_THIS_DURING_AN_TRANSACTION", "25000", "" },
        { ER_ERROR_DURING_COMMIT, "ER_ERROR_DURING_COMMIT", "", "" },
        { ER_ERROR_DURING_ROLLBACK, "ER_ERROR_DURING_ROLLBACK", "", "" },
        { ER_ERROR_DURING_FLUSH_LOGS, "ER_ERROR_DURING_FLUSH_LOGS", "", "" },
        { ER_ERROR_DURING_CHECKPOINT, "ER_ERROR_DURING_CHECKPOINT", "", "" },
        { ER_NEW_ABORTING_CONNECTION, "ER_NEW_ABORTING_CONNECTION", "08S01", "" },
        { ER_DUMP_NOT_IMPLEMENTED, "ER_DUMP_NOT_IMPLEMENTED", "", "" },
        { ER_FLUSH_MASTER_BINLOG_CLOSED, "ER_FLUSH_MASTER_BINLOG_CLOSED", "", "" },
        { ER_INDEX_REBUILD, "ER_INDEX_REBUILD", "", "" },
        { ER_MASTER, "ER_MASTER", "", "" },
        { ER_MASTER_NET_READ, "ER_MASTER_NET_READ", "08S01", "" },
        { ER_MASTER_NET_WRITE, "ER_MASTER_NET_WRITE", "08S01", "" },
        { ER_FT_MATCHING_KEY_NOT_FOUND, "ER_FT_MATCHING_KEY_NOT_FOUND", "", "" },
        { ER_LOCK_OR_ACTIVE_TRANSACTION, "ER_LOCK_OR_ACTIVE_TRANSACTION", "", "" },
        { ER_UNKNOWN_SYSTEM_VARIABLE, "ER_UNKNOWN_SYSTEM_VARIABLE", "", "" },
        { ER_CRASHED_ON_USAGE, "ER_CRASHED_ON_USAGE", "", "" },
        { ER_CRASHED_ON_REPAIR, "ER_CRASHED_ON_REPAIR", "", "" },
        { ER_WARNING_NOT_COMPLETE_ROLLBACK, "ER_WARNING_NOT_COMPLETE_ROLLBACK", "", "" },
        { ER_TRANS_CACHE_FULL, "ER_TRANS_CACHE_FULL", "", "" },
        { ER_SLAVE_MUST_STOP, "ER_SLAVE_MUST_STOP", "", "" },
        { ER_SLAVE_NOT_RUNNING, "ER_SLAVE_NOT_RUNNING", "", "" },
        { ER_BAD_SLAVE, "ER_BAD_SLAVE", "", "" },
        { ER_MASTER_INFO, "ER_MASTER_INFO", "", "" },
        { ER_SLAVE_THREAD, "ER_SLAVE_THREAD", "", "" },
        { ER_TOO_MANY_USER_CONNECTIONS, "ER_TOO_MANY_USER_CONNECTIONS", "42000", "" },
        { ER_SET_CONSTANTS_ONLY, "ER_SET_CONSTANTS_ONLY", "", "" },
        { ER_LOCK_WAIT_TIMEOUT, "ER_LOCK_WAIT_TIMEOUT", "", "" },
        { ER_LOCK_TABLE_FULL, "ER_LOCK_TABLE_FULL", "", "" },
        { ER_READ_ONLY_TRANSACTION, "ER_READ_ONLY_TRANSACTION", "25000", "" },
        { ER_DROP_DB_WITH_READ_LOCK, "ER_DROP_DB_WITH_READ_LOCK", "", "" },
        { ER_CREATE_DB_WITH_READ_LOCK, "ER_CREATE_DB_WITH_READ_LOCK", "", "" },
        { ER_WRONG_ARGUMENTS, "ER_WRONG_ARGUMENTS", "", "" },
        { ER_NO_PERMISSION_TO_CREATE_USER, "ER_NO_PERMISSION_TO_CREATE_USER", "42000", "" },
        { ER_UNION_TABLES_IN_DIFFERENT_DIR, "ER_UNION_TABLES_IN_DIFFERENT_DIR", "", "" },
        { ER_LOCK_DEADLOCK, "ER_LOCK_DEADLOCK", "40001", "" },
        { ER_TABLE_CANT_HANDLE_FT, "ER_TABLE_CANT_HANDLE_FT", "", "" },
        { ER_CANNOT_ADD_FOREIGN, "ER_CANNOT_ADD_FOREIGN", "", "" },
        { ER_NO_REFERENCED_ROW, "ER_NO_REFERENCED_ROW", "23000", "" },
        { ER_ROW_IS_REFERENCED, "ER_ROW_IS_REFERENCED", "23000", "" },
        { ER_CONNECT_TO_MASTER, "ER_CONNECT_TO_MASTER", "08S01", "" },
        { ER_QUERY_ON_MASTER, "ER_QUERY_ON_MASTER", "", "" },
        { ER_ERROR_WHEN_EXECUTING_COMMAND, "ER_ERROR_WHEN_EXECUTING_COMMAND", "", "" },
        { ER_WRONG_USAGE, "ER_WRONG_USAGE", "", "" },
        { ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT, "ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT", "21000", "" },
        { ER_CANT_UPDATE_WITH_READLOCK, "ER_CANT_UPDATE_WITH_READLOCK", "", "" },
        { ER_MIXING_NOT_ALLOWED, "ER_MIXING_NOT_ALLOWED", "", "" },
        { ER_DUP_ARGUMENT, "ER_DUP_ARGUMENT", "", "" },
        { ER_USER_LIMIT_REACHED, "ER_USER_LIMIT_REACHED", "42000", "" },
        { ER_SPECIFIC_ACCESS_DENIED_ERROR, "ER_SPECIFIC_ACCESS_DENIED_ERROR", "42000", "" },
        { ER_LOCAL_VARIABLE, "ER_LOCAL_VARIABLE", "", "" },
        { ER_GLOBAL_VARIABLE, "ER_GLOBAL_VARIABLE", "", "" },
        { ER_NO_DEFAULT, "ER_NO_DEFAULT", "42000", "" },
        { ER_WRONG_VALUE_FOR_VAR, "ER_WRONG_VALUE_FOR_VAR", "42000", "" },
        { ER_WRONG_TYPE_FOR_VAR, "ER_WRONG_TYPE_FOR_VAR", "42000", "" },
        { ER_VAR_CANT_BE_READ, "ER_VAR_CANT_BE_READ", "", "" },
        { ER_CANT_USE_OPTION_HERE, "ER_CANT_USE_OPTION_HERE", "42000", "" },
        { ER_NOT_SUPPORTED_YET, "ER_NOT_SUPPORTED_YET", "42000", "" },
        { ER_MASTER_FATAL_ERROR_READING_BINLOG, "ER_MASTER_FATAL_ERROR_READING_BINLOG", "", "" },
        { ER_SLAVE_IGNORED_TABLE, "ER_SLAVE_IGNORED_TABLE", "", "" },
        { ER_INCORRECT_GLOBAL_LOCAL_VAR, "ER_INCORRECT_GLOBAL_LOCAL_VAR", "", "" },
        { ER_WRONG_FK_DEF, "ER_WRONG_FK_DEF", "42000", "" },
        { ER_KEY_REF_DO_NOT_MATCH_TABLE_REF, "ER_KEY_REF_DO_NOT_MATCH_TABLE_REF", "", "" },
        { ER_OPERAND_COLUMNS, "ER_OPERAND_COLUMNS", "21000", "" },
        { ER_SUBQUERY_NO_1_ROW, "ER_SUBQUERY_NO_1_ROW", "21000", "" },
        { ER_UNKNOWN_STMT_HANDLER, "ER_UNKNOWN_STMT_HANDLER", "", "" },
        { ER_CORRUPT_HELP_DB, "ER_CORRUPT_HELP_DB", "", "" },
        { ER_CYCLIC_REFERENCE, "ER_CYCLIC_REFERENCE", "", "" },
        { ER_AUTO_CONVERT, "ER_AUTO_CONVERT", "", "" },
        { ER_ILLEGAL_REFERENCE, "ER_ILLEGAL_REFERENCE", "42S22", "" },
        { ER_DERIVED_MUST_HAVE_ALIAS, "ER_DERIVED_MUST_HAVE_ALIAS", "42000", "" },
        { ER_SELECT_REDUCED, "ER_SELECT_REDUCED", "01000", "" },
        { ER_TABLENAME_NOT_ALLOWED_HERE, "ER_TABLENAME_NOT_ALLOWED_HERE", "42000", "" },
        { ER_NOT_SUPPORTED_AUTH_MODE, "ER_NOT_SUPPORTED_AUTH_MODE", "08004", "" },
        { ER_SPATIAL_CANT_HAVE_NULL, "ER_SPATIAL_CANT_HAVE_NULL", "42000", "" },
        { ER_COLLATION_CHARSET_MISMATCH, "ER_COLLATION_CHARSET_MISMATCH", "42000", "" },
        { ER_SLAVE_WAS_RUNNING, "ER_SLAVE_WAS_RUNNING", "", "" },
        { ER_SLAVE_WAS_NOT_RUNNING, "ER_SLAVE_WAS_NOT_RUNNING", "", "" },
        { ER_TOO_BIG_FOR_UNCOMPRESS, "ER_TOO_BIG_FOR_UNCOMPRESS", "", "" },
        { ER_ZLIB_Z_MEM_ERROR, "ER_ZLIB_Z_MEM_ERROR", "", "" },
        { ER_ZLIB_Z_BUF_ERROR, "ER_ZLIB_Z_BUF_ERROR", "", "" },
        { ER_ZLIB_Z_DATA_ERROR, "ER_ZLIB_Z_DATA_ERROR", "", "" },
        { ER_CUT_VALUE_GROUP_CONCAT, "ER_CUT_VALUE_GROUP_CONCAT", "", "" },
        { ER_WARN_TOO_FEW_RECORDS, "ER_WARN_TOO_FEW_RECORDS", "01000", "" },
        { ER_WARN_TOO_MANY_RECORDS, "ER_WARN_TOO_MANY_RECORDS", "01000", "" },
        { ER_WARN_NULL_TO_NOTNULL, "ER_WARN_NULL_TO_NOTNULL", "22004", "" },
        { ER_WARN_DATA_OUT_OF_RANGE, "ER_WARN_DATA_OUT_OF_RANGE", "22003", "" },
        { WARN_DATA_TRUNCATED, "WARN_DATA_TRUNCATED", "01000", "" },
        { ER_WARN_USING_OTHER_HANDLER, "ER_WARN_USING_OTHER_HANDLER", "", "" },
        { ER_CANT_AGGREGATE_2COLLATIONS, "ER_CANT_AGGREGATE_2COLLATIONS", "", "" },
        { ER_DROP_USER, "ER_DROP_USER", "", "" },
        { ER_REVOKE_GRANTS, "ER_REVOKE_GRANTS", "", "" },
        { ER_CANT_AGGREGATE_3COLLATIONS, "ER_CANT_AGGREGATE_3COLLATIONS", "", "" },
        { ER_CANT_AGGREGATE_NCOLLATIONS, "ER_CANT_AGGREGATE_NCOLLATIONS", "", "" },
        { ER_VARIABLE_IS_NOT_STRUCT, "ER_VARIABLE_IS_NOT_STRUCT", "", "" },
        { ER_UNKNOWN_COLLATION, "ER_UNKNOWN_COLLATION", "", "" },
        { ER_SLAVE_IGNORED_SSL_PARAMS, "ER_SLAVE_IGNORED_SSL_PARAMS", "", "" },
        { ER_SERVER_IS_IN_SECURE_AUTH_MODE, "ER_SERVER_IS_IN_SECURE_AUTH_MODE", "", "" },
        { ER_WARN_FIELD_RESOLVED, "ER_WARN_FIELD_RESOLVED", "", "" },
        { ER_BAD_SLAVE_UNTIL_COND, "ER_BAD_SLAVE_UNTIL_COND", "", "" },
        { ER_MISSING_SKIP_SLAVE, "ER_MISSING_SKIP_SLAVE", "", "" },
        { ER_UNTIL_COND_IGNORED, "ER_UNTIL_COND_IGNORED", "", "" },
        { ER_WRONG_NAME_FOR_INDEX, "ER_WRONG_NAME_FOR_INDEX", "42000", "" },
        { ER_WRONG_NAME_FOR_CATALOG, "ER_WRONG_NAME_FOR_CATALOG", "42000", "" },
        { ER_WARN_QC_RESIZE, "ER_WARN_QC_RESIZE", "", "" },
        { ER_BAD_FT_COLUMN, "ER_BAD_FT_COLUMN", "", "" },
        { ER_UNKNOWN_KEY_CACHE, "ER_UNKNOWN_KEY_CACHE", "", "" },
        { ER_WARN_HOSTNAME_WONT_WORK, "ER_WARN_HOSTNAME_WONT_WORK", "", "" },
        { ER_UNKNOWN_STORAGE_ENGINE, "ER_UNKNOWN_STORAGE_ENGINE", "42000", "" },
        { ER_WARN_DEPRECATED_SYNTAX, "ER_WARN_DEPRECATED_SYNTAX", "", "" },
        { ER_NON_UPDATABLE_TABLE, "ER_NON_UPDATABLE_TABLE", "", "" },
        { ER_FEATURE_DISABLED, "ER_FEATURE_DISABLED", "", "" },
        { ER_OPTION_PREVENTS_STATEMENT, "ER_OPTION_PREVENTS_STATEMENT", "", "" },
        { ER_DUPLICATED_VALUE_IN_TYPE, "ER_DUPLICATED_VALUE_IN_TYPE", "", "" },
        { ER_TRUNCATED_WRONG_VALUE, "ER_TRUNCATED_WRONG_VALUE", "22007", "" },
        { ER_TOO_MUCH_AUTO_TIMESTAMP_COLS, "ER_TOO_MUCH_AUTO_TIMESTAMP_COLS", "", "" },
        { ER_INVALID_ON_UPDATE, "ER_INVALID_ON_UPDATE", "", "" },
        { ER_UNSUPPORTED_PS, "ER_UNSUPPORTED_PS", "", "" },
        { ER_GET_ERRMSG, "ER_GET_ERRMSG", "", "" },
        { ER_GET_TEMPORARY_ERRMSG, "ER_GET_TEMPORARY_ERRMSG", "", "" },
        { ER_UNKNOWN_TIME_ZONE, "ER_UNKNOWN_TIME_ZONE", "", "" },
        { ER_WARN_INVALID_TIMESTAMP, "ER_WARN_INVALID_TIMESTAMP", "", "" },
        { ER_INVALID_CHARACTER_STRING, "ER_INVALID_CHARACTER_STRING", "", "" },
        { ER_WARN_ALLOWED_PACKET_OVERFLOWED, "ER_WARN_ALLOWED_PACKET_OVERFLOWED", "", "" },
        { ER_CONFLICTING_DECLARATIONS, "ER_CONFLICTING_DECLARATIONS", "", "" },
        { ER_SP_NO_RECURSIVE_CREATE, "ER_SP_NO_RECURSIVE_CREATE", "2F003", "" },
        { ER_SP_ALREADY_EXISTS, "ER_SP_ALREADY_EXISTS", "42000", "" },
        { ER_SP_DOES_NOT_EXIST, "ER_SP_DOES_NOT_EXIST", "42000", "" },
        { ER_SP_DROP_FAILED, "ER_SP_DROP_FAILED", "", "" },
        { ER_SP_STORE_FAILED, "ER_SP_STORE_FAILED", "", "" },
        { ER_SP_LILABEL_MISMATCH, "ER_SP_LILABEL_MISMATCH", "42000", "" },
        { ER_SP_LABEL_REDEFINE, "ER_SP_LABEL_REDEFINE", "42000", "" },
        { ER_SP_LABEL_MISMATCH, "ER_SP_LABEL_MISMATCH", "42000", "" },
        { ER_SP_UNINIT_VAR, "ER_SP_UNINIT_VAR", "01000", "" },
        { ER_SP_BADSELECT, "ER_SP_BADSELECT", "0A000", "" },
        { ER_SP_BADRETURN, "ER_SP_BADRETURN", "42000", "" },
        { ER_SP_BADSTATEMENT, "ER_SP_BADSTATEMENT", "0A000", "" },
        { ER_UPDATE_LOG_DEPRECATED_IGNORED, "ER_UPDATE_LOG_DEPRECATED_IGNORED", "42000", "" },
        { ER_UPDATE_LOG_DEPRECATED_TRANSLATED, "ER_UPDATE_LOG_DEPRECATED_TRANSLATED", "42000", "" },
        { ER_QUERY_INTERRUPTED, "ER_QUERY_INTERRUPTED", "70100", "" },
        { ER_SP_WRONG_NO_OF_ARGS, "ER_SP_WRONG_NO_OF_ARGS", "42000", "" },
        { ER_SP_COND_MISMATCH, "ER_SP_COND_MISMATCH", "42000", "" },
        { ER_SP_NORETURN, "ER_SP_NORETURN", "42000", "" },
        { ER_SP_NORETURNEND, "ER_SP_NORETURNEND", "2F005", "" },
        { ER_SP_BAD_CURSOR_QUERY, "ER_SP_BAD_CURSOR_QUERY", "42000", "" },
        { ER_SP_BAD_CURSOR_SELECT, "ER_SP_BAD_CURSOR_SELECT", "42000", "" },
        { ER_SP_CURSOR_MISMATCH, "ER_SP_CURSOR_MISMATCH", "42000", "" },
        { ER_SP_CURSOR_ALREADY_OPEN, "ER_SP_CURSOR_ALREADY_OPEN", "24000", "" },
        { ER_SP_CURSOR_NOT_OPEN, "ER_SP_CURSOR_NOT_OPEN", "24000", "" },
        { ER_SP_UNDECLARED_VAR, "ER_SP_UNDECLARED_VAR", "42000", "" },
        { ER_SP_WRONG_NO_OF_FETCH_ARGS, "ER_SP_WRONG_NO_OF_FETCH_ARGS", "", "" },
        { ER_SP_FETCH_NO_DATA, "ER_SP_FETCH_NO_DATA", "02000", "" },
        { ER_SP_DUP_PARAM, "ER_SP_DUP_PARAM", "42000", "" },
        { ER_SP_DUP_VAR, "ER_SP_DUP_VAR", "42000", "" },
        { ER_SP_DUP_COND, "ER_SP_DUP_COND", "42000", "" },
        { ER_SP_DUP_CURS, "ER_SP_DUP_CURS", "42000", "" },
        { ER_SP_CANT_ALTER, "ER_SP_CANT_ALTER", "", "" },
        { ER_SP_SUBSELECT_NYI, "ER_SP_SUBSELECT_NYI", "0A000", "" },
        { ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG, "ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG", "0A000", "" },
        { ER_SP_VARCOND_AFTER_CURSHNDLR, "ER_SP_VARCOND_AFTER_CURSHNDLR", "42000", "" },
        { ER_SP_CURSOR_AFTER_HANDLER, "ER_SP_CURSOR_AFTER_HANDLER", "42000", "" },
        { ER_SP_CASE_NOT_FOUND, "ER_SP_CASE_NOT_FOUND", "20000", "" },
        { ER_FPARSER_TOO_BIG_FILE, "ER_FPARSER_TOO_BIG_FILE", "", "" },
        { ER_FPARSER_BAD_HEADER, "ER_FPARSER_BAD_HEADER", "", "" },
        { ER_FPARSER_EOF_IN_COMMENT, "ER_FPARSER_EOF_IN_COMMENT", "", "" },
        { ER_FPARSER_ERROR_IN_PARAMETER, "ER_FPARSER_ERROR_IN_PARAMETER", "", "" },
        { ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER, "ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER", "", "" },
        { ER_VIEW_NO_EXPLAIN, "ER_VIEW_NO_EXPLAIN", "", "" },
        { ER_FRM_UNKNOWN_TYPE, "ER_FRM_UNKNOWN_TYPE", "", "" },
        { ER_WRONG_OBJECT, "ER_WRONG_OBJECT", "", "" },
        { ER_NONUPDATEABLE_COLUMN, "ER_NONUPDATEABLE_COLUMN", "", "" },
        { ER_VIEW_SELECT_DERIVED, "ER_VIEW_SELECT_DERIVED", "", "" },
        { ER_VIEW_SELECT_CLAUSE, "ER_VIEW_SELECT_CLAUSE", "", "" },
        { ER_VIEW_SELECT_VARIABLE, "ER_VIEW_SELECT_VARIABLE", "", "" },
        { ER_VIEW_SELECT_TMPTABLE, "ER_VIEW_SELECT_TMPTABLE", "", "" },
        { ER_VIEW_WRONG_LIST, "ER_VIEW_WRONG_LIST", "", "" },
        { ER_WARN_VIEW_MERGE, "ER_WARN_VIEW_MERGE", "", "" },
        { ER_WARN_VIEW_WITHOUT_KEY, "ER_WARN_VIEW_WITHOUT_KEY", "", "" },
        { ER_VIEW_INVALID, "ER_VIEW_INVALID", "", "" },
        { ER_SP_NO_DROP_SP, "ER_SP_NO_DROP_SP", "", "" },
        { ER_SP_GOTO_IN_HNDLR, "ER_SP_GOTO_IN_HNDLR", "", "" },
        { ER_TRG_ALREADY_EXISTS, "ER_TRG_ALREADY_EXISTS", "", "" },
        { ER_TRG_DOES_NOT_EXIST, "ER_TRG_DOES_NOT_EXIST", "", "" },
        { ER_TRG_ON_VIEW_OR_TEMP_TABLE, "ER_TRG_ON_VIEW_OR_TEMP_TABLE", "", "" },
        { ER_TRG_CANT_CHANGE_ROW, "ER_TRG_CANT_CHANGE_ROW", "", "" },
        { ER_TRG_NO_SUCH_ROW_IN_TRG, "ER_TRG_NO_SUCH_ROW_IN_TRG", "", "" },
        { ER_NO_DEFAULT_FOR_FIELD, "ER_NO_DEFAULT_FOR_FIELD", "", "" },
        { ER_DIVISION_BY_ZERO, "ER_DIVISION_BY_ZERO", "22012", "" },
        { ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, "ER_TRUNCATED_WRONG_VALUE_FOR_FIELD", "", "" },
        { ER_ILLEGAL_VALUE_FOR_TYPE, "ER_ILLEGAL_VALUE_FOR_TYPE", "22007", "" },
        { ER_VIEW_NONUPD_CHECK, "ER_VIEW_NONUPD_CHECK", "", "" },
        { ER_VIEW_CHECK_FAILED, "ER_VIEW_CHECK_FAILED", "", "" },
        { ER_PROCACCESS_DENIED_ERROR, "ER_PROCACCESS_DENIED_ERROR", "42000", "" },
        { ER_RELAY_LOG_FAIL, "ER_RELAY_LOG_FAIL", "", "" },
        { ER_PASSWD_LENGTH, "ER_PASSWD_LENGTH", "", "" },
        { ER_UNKNOWN_TARGET_BINLOG, "ER_UNKNOWN_TARGET_BINLOG", "", "" },
        { ER_IO_ERR_LOG_INDEX_READ, "ER_IO_ERR_LOG_INDEX_READ", "", "" },
        { ER_BINLOG_PURGE_PROHIBITED, "ER_BINLOG_PURGE_PROHIBITED", "", "" },
        { ER_FSEEK_FAIL, "ER_FSEEK_FAIL", "", "" },
        { ER_BINLOG_PURGE_FATAL_ERR, "ER_BINLOG_PURGE_FATAL_ERR", "", "" },
        { ER_LOG_IN_USE, "ER_LOG_IN_USE", "", "" },
        { ER_LOG_PURGE_UNKNOWN_ERR, "ER_LOG_PURGE_UNKNOWN_ERR", "", "" },
        { ER_RELAY_LOG_INIT, "ER_RELAY_LOG_INIT", "", "" },
        { ER_NO_BINARY_LOGGING, "ER_NO_BINARY_LOGGING", "", "" },
        { ER_RESERVED_SYNTAX, "ER_RESERVED_SYNTAX", "", "" },
        { ER_WSAS_FAILED, "ER_WSAS_FAILED", "", "" },
        { ER_DIFF_GROUPS_PROC, "ER_DIFF_GROUPS_PROC", "", "" },
        { ER_NO_GROUP_FOR_PROC, "ER_NO_GROUP_FOR_PROC", "", "" },
        { ER_ORDER_WITH_PROC, "ER_ORDER_WITH_PROC", "", "" },
        { ER_LOGGING_PROHIBIT_CHANGING_OF, "ER_LOGGING_PROHIBIT_CHANGING_OF", "", "" },
        { ER_NO_FILE_MAPPING, "ER_NO_FILE_MAPPING", "", "" },
        { ER_WRONG_MAGIC, "ER_WRONG_MAGIC", "", "" },
        { ER_PS_MANY_PARAM, "ER_PS_MANY_PARAM", "", "" },
        { ER_KEY_PART_0, "ER_KEY_PART_0", "", "" },
        { ER_VIEW_CHECKSUM, "ER_VIEW_CHECKSUM", "", "" },
        { ER_VIEW_MULTIUPDATE, "ER_VIEW_MULTIUPDATE", "", "" },
        { ER_VIEW_NO_INSERT_FIELD_LIST, "ER_VIEW_NO_INSERT_FIELD_LIST", "", "" },
        { ER_VIEW_DELETE_MERGE_VIEW, "ER_VIEW_DELETE_MERGE_VIEW", "", "" },
        { ER_CANNOT_USER, "ER_CANNOT_USER", "", "" },
        { ER_XAER_NOTA, "ER_XAER_NOTA", "XAE04", "" },
        { ER_XAER_INVAL, "ER_XAER_INVAL", "XAE05", "" },
        { ER_XAER_RMFAIL, "ER_XAER_RMFAIL", "XAE07", "" },
        { ER_XAER_OUTSIDE, "ER_XAER_OUTSIDE", "XAE09", "" },
        { ER_XAER_RMERR, "ER_XAER_RMERR", "XAE03", "" },
        { ER_XA_RBROLLBACK, "ER_XA_RBROLLBACK", "XA100", "" },
        { ER_NONEXISTING_PROC_GRANT, "ER_NONEXISTING_PROC_GRANT", "42000", "" },
        { ER_PROC_AUTO_GRANT_FAIL, "ER_PROC_AUTO_GRANT_FAIL", "", "" },
        { ER_PROC_AUTO_REVOKE_FAIL, "ER_PROC_AUTO_REVOKE_FAIL", "", "" },
        { ER_DATA_TOO_LONG, "ER_DATA_TOO_LONG", "22001", "" },
        { ER_SP_BAD_SQLSTATE, "ER_SP_BAD_SQLSTATE", "42000", "" },
        { ER_STARTUP, "ER_STARTUP", "", "" },
        { ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR, "ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR", "", "" },
        { ER_CANT_CREATE_USER_WITH_GRANT, "ER_CANT_CREATE_USER_WITH_GRANT", "42000", "" },
        { ER_WRONG_VALUE_FOR_TYPE, "ER_WRONG_VALUE_FOR_TYPE", "", "" },
        { ER_TABLE_DEF_CHANGED, "ER_TABLE_DEF_CHANGED", "", "" },
        { ER_SP_DUP_HANDLER, "ER_SP_DUP_HANDLER", "42000", "" },
        { ER_SP_NOT_VAR_ARG, "ER_SP_NOT_VAR_ARG", "42000", "" },
        { ER_SP_NO_RETSET, "ER_SP_NO_RETSET", "0A000", "" },
        { ER_CANT_CREATE_GEOMETRY_OBJECT, "ER_CANT_CREATE_GEOMETRY_OBJECT", "22003", "" },
        { ER_FAILED_ROUTINE_BREAK_BINLOG, "ER_FAILED_ROUTINE_BREAK_BINLOG", "", "" },
        { ER_BINLOG_UNSAFE_ROUTINE, "ER_BINLOG_UNSAFE_ROUTINE", "", "" },
        { ER_BINLOG_CREATE_ROUTINE_NEED_SUPER, "ER_BINLOG_CREATE_ROUTINE_NEED_SUPER", "", "" },
        { ER_EXEC_STMT_WITH_OPEN_CURSOR, "ER_EXEC_STMT_WITH_OPEN_CURSOR", "", "" },
        { ER_STMT_HAS_NO_OPEN_CURSOR, "ER_STMT_HAS_NO_OPEN_CURSOR", "", "" },
        { ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, "ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG", "", "" },
        { ER_NO_DEFAULT_FOR_VIEW_FIELD, "ER_NO_DEFAULT_FOR_VIEW_FIELD", "", "" },
        { ER_SP_NO_RECURSION, "ER_SP_NO_RECURSION", "", "" },
        { ER_TOO_BIG_SCALE, "ER_TOO_BIG_SCALE", "42000", "S1009" },
        { ER_TOO_BIG_PRECISION, "ER_TOO_BIG_PRECISION", "42000", "S1009" },
        { ER_M_BIGGER_THAN_D, "ER_M_BIGGER_THAN_D", "42000", "S1009" },
        { ER_WRONG_LOCK_OF_SYSTEM_TABLE, "ER_WRONG_LOCK_OF_SYSTEM_TABLE", "", "" },
        { ER_CONNECT_TO_FOREIGN_DATA_SOURCE, "ER_CONNECT_TO_FOREIGN_DATA_SOURCE", "", "" },
        { ER_QUERY_ON_FOREIGN_DATA_SOURCE, "ER_QUERY_ON_FOREIGN_DATA_SOURCE", "", "" },
        { ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST, "ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST", "", "" },
        { ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE, "ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE", "", "" },
        { ER_FOREIGN_DATA_STRING_INVALID, "ER_FOREIGN_DATA_STRING_INVALID", "", "" },
        { ER_CANT_CREATE_FEDERATED_TABLE, "ER_CANT_CREATE_FEDERATED_TABLE", "", "" },
        { ER_TRG_IN_WRONG_SCHEMA, "ER_TRG_IN_WRONG_SCHEMA", "", "" },
        { ER_STACK_OVERRUN_NEED_MORE, "ER_STACK_OVERRUN_NEED_MORE", "", "" },
        { ER_TOO_LONG_BODY, "ER_TOO_LONG_BODY", "42000", "S1009" },
        { ER_WARN_CANT_DROP_DEFAULT_KEYCACHE, "ER_WARN_CANT_DROP_DEFAULT_KEYCACHE", "", "" },
        { ER_TOO_BIG_DISPLAYWIDTH, "ER_TOO_BIG_DISPLAYWIDTH", "42000", "S1009" },
        { ER_XAER_DUPID, "ER_XAER_DUPID", "XAE08", "" },
        { ER_DATETIME_FUNCTION_OVERFLOW, "ER_DATETIME_FUNCTION_OVERFLOW", "22008", "" },
        { ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG, "ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG", "", "" },
        { ER_VIEW_PREVENT_UPDATE, "ER_VIEW_PREVENT_UPDATE", "", "" },
        { ER_PS_NO_RECURSION, "ER_PS_NO_RECURSION", "", "" },
        { ER_SP_CANT_SET_AUTOCOMMIT, "ER_SP_CANT_SET_AUTOCOMMIT", "", "" },
        { ER_MALFORMED_DEFINER, "ER_MALFORMED_DEFINER", "", "" },
        { ER_VIEW_FRM_NO_USER, "ER_VIEW_FRM_NO_USER", "", "" },
        { ER_VIEW_OTHER_USER, "ER_VIEW_OTHER_USER", "", "" },
        { ER_NO_SUCH_USER, "ER_NO_SUCH_USER", "", "" },
        { ER_FORBID_SCHEMA_CHANGE, "ER_FORBID_SCHEMA_CHANGE", "", "" },
        { ER_ROW_IS_REFERENCED_2, "ER_ROW_IS_REFERENCED_2", "23000", "" },
        { ER_NO_REFERENCED_ROW_2, "ER_NO_REFERENCED_ROW_2", "23000", "" },
        { ER_SP_BAD_VAR_SHADOW, "ER_SP_BAD_VAR_SHADOW", "42000", "" },
        { ER_TRG_NO_DEFINER, "ER_TRG_NO_DEFINER", "", "" },
        { ER_OLD_FILE_FORMAT, "ER_OLD_FILE_FORMAT", "", "" },
        { ER_SP_RECURSION_LIMIT, "ER_SP_RECURSION_LIMIT", "", "" },
        { ER_SP_PROC_TABLE_CORRUPT, "ER_SP_PROC_TABLE_CORRUPT", "", "" },
        { ER_SP_WRONG_NAME, "ER_SP_WRONG_NAME", "42000", "" },
        { ER_TABLE_NEEDS_UPGRADE, "ER_TABLE_NEEDS_UPGRADE", "", "" },
        { ER_SP_NO_AGGREGATE, "ER_SP_NO_AGGREGATE", "42000", "" },
        { ER_MAX_PREPARED_STMT_COUNT_REACHED, "ER_MAX_PREPARED_STMT_COUNT_REACHED", "42000", "" },
        { ER_VIEW_RECURSIVE, "ER_VIEW_RECURSIVE", "", "" },
        { ER_NON_GROUPING_FIELD_USED, "ER_NON_GROUPING_FIELD_USED", "42000", "" },
        { ER_TABLE_CANT_HANDLE_SPKEYS, "ER_TABLE_CANT_HANDLE_SPKEYS", "", "" },
        { ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA, "ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA", "", "" },
        { ER_REMOVED_SPACES, "ER_REMOVED_SPACES", "", "" },
        { ER_AUTOINC_READ_FAILED, "ER_AUTOINC_READ_FAILED", "", "" },
        { ER_USERNAME, "ER_USERNAME", "", "" },
        { ER_HOSTNAME, "ER_HOSTNAME", "", "" },
        { ER_WRONG_STRING_LENGTH, "ER_WRONG_STRING_LENGTH", "", "" },
        { ER_NON_INSERTABLE_TABLE, "ER_NON_INSERTABLE_TABLE", "", "" },
        { ER_ADMIN_WRONG_MRG_TABLE, "ER_ADMIN_WRONG_MRG_TABLE", "", "" },
        { ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT, "ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT", "", "" },
        { ER_NAME_BECOMES_EMPTY, "ER_NAME_BECOMES_EMPTY", "", "" },
        { ER_AMBIGUOUS_FIELD_TERM, "ER_AMBIGUOUS_FIELD_TERM", "", "" },
        { ER_FOREIGN_SERVER_EXISTS, "ER_FOREIGN_SERVER_EXISTS", "", "" },
        { ER_FOREIGN_SERVER_DOESNT_EXIST, "ER_FOREIGN_SERVER_DOESNT_EXIST", "", "" },
        { ER_ILLEGAL_HA_CREATE_OPTION, "ER_ILLEGAL_HA_CREATE_OPTION", "", "" },
        { ER_PARTITION_REQUIRES_VALUES_ERROR, "ER_PARTITION_REQUIRES_VALUES_ERROR", "", "" },
        { ER_PARTITION_WRONG_VALUES_ERROR, "ER_PARTITION_WRONG_VALUES_ERROR", "", "" },
        { ER_PARTITION_MAXVALUE_ERROR, "ER_PARTITION_MAXVALUE_ERROR", "", "" },
        { ER_PARTITION_SUBPARTITION_ERROR, "ER_PARTITION_SUBPARTITION_ERROR", "", "" },
        { ER_PARTITION_SUBPART_MIX_ERROR, "ER_PARTITION_SUBPART_MIX_ERROR", "", "" },
        { ER_PARTITION_WRONG_NO_PART_ERROR, "ER_PARTITION_WRONG_NO_PART_ERROR", "", "" },
        { ER_PARTITION_WRONG_NO_SUBPART_ERROR, "ER_PARTITION_WRONG_NO_SUBPART_ERROR", "", "" },
        { ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR, "ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR", "", "" },
        { ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR, "ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR", "", "" },
        { ER_FIELD_NOT_FOUND_PART_ERROR, "ER_FIELD_NOT_FOUND_PART_ERROR", "", "" },
        { ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR, "ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR", "", "" },
        { ER_INCONSISTENT_PARTITION_INFO_ERROR, "ER_INCONSISTENT_PARTITION_INFO_ERROR", "", "" },
        { ER_PARTITION_FUNC_NOT_ALLOWED_ERROR, "ER_PARTITION_FUNC_NOT_ALLOWED_ERROR", "", "" },
        { ER_PARTITIONS_MUST_BE_DEFINED_ERROR, "ER_PARTITIONS_MUST_BE_DEFINED_ERROR", "", "" },
        { ER_RANGE_NOT_INCREASING_ERROR, "ER_RANGE_NOT_INCREASING_ERROR", "", "" },
        { ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR, "ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR", "", "" },
        { ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, "ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR", "", "" },
        { ER_PARTITION_ENTRY_ERROR, "ER_PARTITION_ENTRY_ERROR", "", "" },
        { ER_MIX_HANDLER_ERROR, "ER_MIX_HANDLER_ERROR", "", "" },
        { ER_PARTITION_NOT_DEFINED_ERROR, "ER_PARTITION_NOT_DEFINED_ERROR", "", "" },
        { ER_TOO_MANY_PARTITIONS_ERROR, "ER_TOO_MANY_PARTITIONS_ERROR", "", "" },
        { ER_SUBPARTITION_ERROR, "ER_SUBPARTITION_ERROR", "", "" },
        { ER_CANT_CREATE_HANDLER_FILE, "ER_CANT_CREATE_HANDLER_FILE", "", "" },
        { ER_BLOB_FIELD_IN_PART_FUNC_ERROR, "ER_BLOB_FIELD_IN_PART_FUNC_ERROR", "", "" },
        { ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF, "ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF", "", "" },
        { ER_NO_PARTS_ERROR, "ER_NO_PARTS_ERROR", "", "" },
        { ER_PARTITION_MGMT_ON_NONPARTITIONED, "ER_PARTITION_MGMT_ON_NONPARTITIONED", "", "" },
        { ER_FOREIGN_KEY_ON_PARTITIONED, "ER_FOREIGN_KEY_ON_PARTITIONED", "", "" },
        { ER_DROP_PARTITION_NON_EXISTENT, "ER_DROP_PARTITION_NON_EXISTENT", "", "" },
        { ER_DROP_LAST_PARTITION, "ER_DROP_LAST_PARTITION", "", "" },
        { ER_COALESCE_ONLY_ON_HASH_PARTITION, "ER_COALESCE_ONLY_ON_HASH_PARTITION", "", "" },
        { ER_REORG_HASH_ONLY_ON_SAME_NO, "ER_REORG_HASH_ONLY_ON_SAME_NO", "", "" },
        { ER_REORG_NO_PARAM_ERROR, "ER_REORG_NO_PARAM_ERROR", "", "" },
        { ER_ONLY_ON_RANGE_LIST_PARTITION, "ER_ONLY_ON_RANGE_LIST_PARTITION", "", "" },
        { ER_ADD_PARTITION_SUBPART_ERROR, "ER_ADD_PARTITION_SUBPART_ERROR", "", "" },
        { ER_ADD_PARTITION_NO_NEW_PARTITION, "ER_ADD_PARTITION_NO_NEW_PARTITION", "", "" },
        { ER_COALESCE_PARTITION_NO_PARTITION, "ER_COALESCE_PARTITION_NO_PARTITION", "", "" },
        { ER_REORG_PARTITION_NOT_EXIST, "ER_REORG_PARTITION_NOT_EXIST", "", "" },
        { ER_SAME_NAME_PARTITION, "ER_SAME_NAME_PARTITION", "", "" },
        { ER_NO_BINLOG_ERROR, "ER_NO_BINLOG_ERROR", "", "" },
        { ER_CONSECUTIVE_REORG_PARTITIONS, "ER_CONSECUTIVE_REORG_PARTITIONS", "", "" },
        { ER_REORG_OUTSIDE_RANGE, "ER_REORG_OUTSIDE_RANGE", "", "" },
        { ER_PARTITION_FUNCTION_FAILURE, "ER_PARTITION_FUNCTION_FAILURE", "", "" },
        { ER_PART_STATE_ERROR, "ER_PART_STATE_ERROR", "", "" },
        { ER_LIMITED_PART_RANGE, "ER_LIMITED_PART_RANGE", "", "" },
        { ER_PLUGIN_IS_NOT_LOADED, "ER_PLUGIN_IS_NOT_LOADED", "", "" },
        { ER_WRONG_VALUE, "ER_WRONG_VALUE", "", "" },
        { ER_NO_PARTITION_FOR_GIVEN_VALUE, "ER_NO_PARTITION_FOR_GIVEN_VALUE", "", "" },
        { ER_FILEGROUP_OPTION_ONLY_ONCE, "ER_FILEGROUP_OPTION_ONLY_ONCE", "", "" },
        { ER_CREATE_FILEGROUP_FAILED, "ER_CREATE_FILEGROUP_FAILED", "", "" },
        { ER_DROP_FILEGROUP_FAILED, "ER_DROP_FILEGROUP_FAILED", "", "" },
        { ER_TABLESPACE_AUTO_EXTEND_ERROR, "ER_TABLESPACE_AUTO_EXTEND_ERROR", "", "" },
        { ER_WRONG_SIZE_NUMBER, "ER_WRONG_SIZE_NUMBER", "", "" },
        { ER_SIZE_OVERFLOW_ERROR, "ER_SIZE_OVERFLOW_ERROR", "", "" },
        { ER_ALTER_FILEGROUP_FAILED, "ER_ALTER_FILEGROUP_FAILED", "", "" },
        { ER_BINLOG_ROW_LOGGING_FAILED, "ER_BINLOG_ROW_LOGGING_FAILED", "", "" },
        { ER_BINLOG_ROW_WRONG_TABLE_DEF, "ER_BINLOG_ROW_WRONG_TABLE_DEF", "", "" },
        { ER_BINLOG_ROW_RBR_TO_SBR, "ER_BINLOG_ROW_RBR_TO_SBR", "", "" },
        { ER_EVENT_ALREADY_EXISTS, "ER_EVENT_ALREADY_EXISTS", "", "" },
        { ER_EVENT_STORE_FAILED, "ER_EVENT_STORE_FAILED", "", "" },
        { ER_EVENT_DOES_NOT_EXIST, "ER_EVENT_DOES_NOT_EXIST", "", "" },
        { ER_EVENT_CANT_ALTER, "ER_EVENT_CANT_ALTER", "", "" },
        { ER_EVENT_DROP_FAILED, "ER_EVENT_DROP_FAILED", "", "" },
        { ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG, "ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG", "", "" },
        { ER_EVENT_ENDS_BEFORE_STARTS, "ER_EVENT_ENDS_BEFORE_STARTS", "", "" },
        { ER_EVENT_EXEC_TIME_IN_THE_PAST, "ER_EVENT_EXEC_TIME_IN_THE_PAST", "", "" },
        { ER_EVENT_OPEN_TABLE_FAILED, "ER_EVENT_OPEN_TABLE_FAILED", "", "" },
        { ER_EVENT_NEITHER_M_EXPR_NOR_M_AT, "ER_EVENT_NEITHER_M_EXPR_NOR_M_AT", "", "" },
        { ER_OBSOLETE_COL_COUNT_DOESNT_MATCH_CORRUPTED, "ER_OBSOLETE_COL_COUNT_DOESNT_MATCH_CORRUPTED", "", "" },
        { ER_OBSOLETE_CANNOT_LOAD_FROM_TABLE, "ER_OBSOLETE_CANNOT_LOAD_FROM_TABLE", "", "" },
        { ER_EVENT_CANNOT_DELETE, "ER_EVENT_CANNOT_DELETE", "", "" },
        { ER_EVENT_COMPILE_ERROR, "ER_EVENT_COMPILE_ERROR", "", "" },
        { ER_EVENT_SAME_NAME, "ER_EVENT_SAME_NAME", "", "" },
        { ER_EVENT_DATA_TOO_LONG, "ER_EVENT_DATA_TOO_LONG", "", "" },
        { ER_DROP_INDEX_FK, "ER_DROP_INDEX_FK", "", "" },
        { ER_WARN_DEPRECATED_SYNTAX_WITH_VER, "ER_WARN_DEPRECATED_SYNTAX_WITH_VER", "", "" },
        { ER_CANT_WRITE_LOCK_LOG_TABLE, "ER_CANT_WRITE_LOCK_LOG_TABLE", "", "" },
        { ER_CANT_LOCK_LOG_TABLE, "ER_CANT_LOCK_LOG_TABLE", "", "" },
        { ER_FOREIGN_DUPLICATE_KEY_OLD_UNUSED, "ER_FOREIGN_DUPLICATE_KEY_OLD_UNUSED", "23000", "S1009" },
        { ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE, "ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE", "", "" },
        { ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR, "ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR", "", "" },
        { ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT, "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT", "", "" },
        { ER_NDB_CANT_SWITCH_BINLOG_FORMAT, "ER_NDB_CANT_SWITCH_BINLOG_FORMAT", "", "" },
        { ER_PARTITION_NO_TEMPORARY, "ER_PARTITION_NO_TEMPORARY", "", "" },
        { ER_PARTITION_CONST_DOMAIN_ERROR, "ER_PARTITION_CONST_DOMAIN_ERROR", "", "" },
        { ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, "ER_PARTITION_FUNCTION_IS_NOT_ALLOWED", "", "" },
        { ER_DDL_LOG_ERROR, "ER_DDL_LOG_ERROR", "", "" },
        { ER_NULL_IN_VALUES_LESS_THAN, "ER_NULL_IN_VALUES_LESS_THAN", "", "" },
        { ER_WRONG_PARTITION_NAME, "ER_WRONG_PARTITION_NAME", "", "" },
        { ER_CANT_CHANGE_TX_CHARACTERISTICS, "ER_CANT_CHANGE_TX_CHARACTERISTICS", "25001", "" },
        { ER_DUP_ENTRY_AUTOINCREMENT_CASE, "ER_DUP_ENTRY_AUTOINCREMENT_CASE", "", "" },
        { ER_EVENT_MODIFY_QUEUE_ERROR, "ER_EVENT_MODIFY_QUEUE_ERROR", "", "" },
        { ER_EVENT_SET_VAR_ERROR, "ER_EVENT_SET_VAR_ERROR", "", "" },
        { ER_PARTITION_MERGE_ERROR, "ER_PARTITION_MERGE_ERROR", "", "" },
        { ER_CANT_ACTIVATE_LOG, "ER_CANT_ACTIVATE_LOG", "", "" },
        { ER_RBR_NOT_AVAILABLE, "ER_RBR_NOT_AVAILABLE", "", "" },
        { ER_BASE64_DECODE_ERROR, "ER_BASE64_DECODE_ERROR", "", "" },
        { ER_EVENT_RECURSION_FORBIDDEN, "ER_EVENT_RECURSION_FORBIDDEN", "", "" },
        { ER_EVENTS_DB_ERROR, "ER_EVENTS_DB_ERROR", "", "" },
        { ER_ONLY_INTEGERS_ALLOWED, "ER_ONLY_INTEGERS_ALLOWED", "", "" },
        { ER_UNSUPORTED_LOG_ENGINE, "ER_UNSUPORTED_LOG_ENGINE", "", "" },
        { ER_BAD_LOG_STATEMENT, "ER_BAD_LOG_STATEMENT", "", "" },
        { ER_CANT_RENAME_LOG_TABLE, "ER_CANT_RENAME_LOG_TABLE", "", "" },
        { ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, "ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT", "42000", "" },
        { ER_WRONG_PARAMETERS_TO_NATIVE_FCT, "ER_WRONG_PARAMETERS_TO_NATIVE_FCT", "42000", "" },
        { ER_WRONG_PARAMETERS_TO_STORED_FCT, "ER_WRONG_PARAMETERS_TO_STORED_FCT", "42000", "" },
        { ER_NATIVE_FCT_NAME_COLLISION, "ER_NATIVE_FCT_NAME_COLLISION", "", "" },
        { ER_DUP_ENTRY_WITH_KEY_NAME, "ER_DUP_ENTRY_WITH_KEY_NAME", "23000", "S1009" },
        { ER_BINLOG_PURGE_EMFILE, "ER_BINLOG_PURGE_EMFILE", "", "" },
        { ER_EVENT_CANNOT_CREATE_IN_THE_PAST, "ER_EVENT_CANNOT_CREATE_IN_THE_PAST", "", "" },
        { ER_EVENT_CANNOT_ALTER_IN_THE_PAST, "ER_EVENT_CANNOT_ALTER_IN_THE_PAST", "", "" },
        { ER_SLAVE_INCIDENT, "ER_SLAVE_INCIDENT", "", "" },
        { ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT, "ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT", "", "" },
        { ER_BINLOG_UNSAFE_STATEMENT, "ER_BINLOG_UNSAFE_STATEMENT", "", "" },
        { ER_SLAVE_FATAL_ERROR, "ER_SLAVE_FATAL_ERROR", "", "" },
        { ER_SLAVE_RELAY_LOG_READ_FAILURE, "ER_SLAVE_RELAY_LOG_READ_FAILURE", "", "" },
        { ER_SLAVE_RELAY_LOG_WRITE_FAILURE, "ER_SLAVE_RELAY_LOG_WRITE_FAILURE", "", "" },
        { ER_SLAVE_CREATE_EVENT_FAILURE, "ER_SLAVE_CREATE_EVENT_FAILURE", "", "" },
        { ER_SLAVE_MASTER_COM_FAILURE, "ER_SLAVE_MASTER_COM_FAILURE", "", "" },
        { ER_BINLOG_LOGGING_IMPOSSIBLE, "ER_BINLOG_LOGGING_IMPOSSIBLE", "", "" },
        { ER_VIEW_NO_CREATION_CTX, "ER_VIEW_NO_CREATION_CTX", "", "" },
        { ER_VIEW_INVALID_CREATION_CTX, "ER_VIEW_INVALID_CREATION_CTX", "", "" },
        { ER_SR_INVALID_CREATION_CTX, "ER_SR_INVALID_CREATION_CTX", "", "" },
        { ER_TRG_CORRUPTED_FILE, "ER_TRG_CORRUPTED_FILE", "", "" },
        { ER_TRG_NO_CREATION_CTX, "ER_TRG_NO_CREATION_CTX", "", "" },
        { ER_TRG_INVALID_CREATION_CTX, "ER_TRG_INVALID_CREATION_CTX", "", "" },
        { ER_EVENT_INVALID_CREATION_CTX, "ER_EVENT_INVALID_CREATION_CTX", "", "" },
        { ER_TRG_CANT_OPEN_TABLE, "ER_TRG_CANT_OPEN_TABLE", "", "" },
        { ER_CANT_CREATE_SROUTINE, "ER_CANT_CREATE_SROUTINE", "", "" },
        { ER_NEVER_USED, "ER_NEVER_USED", "", "" },
        { ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT, "ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT", "", "" },
        { ER_SLAVE_CORRUPT_EVENT, "ER_SLAVE_CORRUPT_EVENT", "", "" },
        { ER_LOAD_DATA_INVALID_COLUMN, "ER_LOAD_DATA_INVALID_COLUMN", "", "" },
        { ER_LOG_PURGE_NO_FILE, "ER_LOG_PURGE_NO_FILE", "", "" },
        { ER_XA_RBTIMEOUT, "ER_XA_RBTIMEOUT", "XA106", "" },
        { ER_XA_RBDEADLOCK, "ER_XA_RBDEADLOCK", "XA102", "" },
        { ER_NEED_REPREPARE, "ER_NEED_REPREPARE", "", "" },
        { ER_DELAYED_NOT_SUPPORTED, "ER_DELAYED_NOT_SUPPORTED", "", "" },
        { WARN_NO_MASTER_INFO, "WARN_NO_MASTER_INFO", "", "" },
        { WARN_OPTION_IGNORED, "WARN_OPTION_IGNORED", "", "" },
        { WARN_PLUGIN_DELETE_BUILTIN, "WARN_PLUGIN_DELETE_BUILTIN", "", "" },
        { WARN_PLUGIN_BUSY, "WARN_PLUGIN_BUSY", "", "" },
        { ER_VARIABLE_IS_READONLY, "ER_VARIABLE_IS_READONLY", "", "" },
        { ER_WARN_ENGINE_TRANSACTION_ROLLBACK, "ER_WARN_ENGINE_TRANSACTION_ROLLBACK", "", "" },
        { ER_SLAVE_HEARTBEAT_FAILURE, "ER_SLAVE_HEARTBEAT_FAILURE", "", "" },
        { ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE, "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE", "", "" },
        { ER_NDB_REPLICATION_SCHEMA_ERROR, "ER_NDB_REPLICATION_SCHEMA_ERROR", "", "" },
        { ER_CONFLICT_FN_PARSE_ERROR, "ER_CONFLICT_FN_PARSE_ERROR", "", "" },
        { ER_EXCEPTIONS_WRITE_ERROR, "ER_EXCEPTIONS_WRITE_ERROR", "", "" },
        { ER_TOO_LONG_TABLE_COMMENT, "ER_TOO_LONG_TABLE_COMMENT", "", "" },
        { ER_TOO_LONG_FIELD_COMMENT, "ER_TOO_LONG_FIELD_COMMENT", "", "" },
        { ER_FUNC_INEXISTENT_NAME_COLLISION, "ER_FUNC_INEXISTENT_NAME_COLLISION", "42000", "" },
        { ER_DATABASE_NAME, "ER_DATABASE_NAME", "", "" },
        { ER_TABLE_NAME, "ER_TABLE_NAME", "", "" },
        { ER_PARTITION_NAME, "ER_PARTITION_NAME", "", "" },
        { ER_SUBPARTITION_NAME, "ER_SUBPARTITION_NAME", "", "" },
        { ER_TEMPORARY_NAME, "ER_TEMPORARY_NAME", "", "" },
        { ER_RENAMED_NAME, "ER_RENAMED_NAME", "", "" },
        { ER_TOO_MANY_CONCURRENT_TRXS, "ER_TOO_MANY_CONCURRENT_TRXS", "", "" },
        { WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED, "WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED", "", "" },
        { ER_DEBUG_SYNC_TIMEOUT, "ER_DEBUG_SYNC_TIMEOUT", "", "" },
        { ER_DEBUG_SYNC_HIT_LIMIT, "ER_DEBUG_SYNC_HIT_LIMIT", "", "" },
        { ER_DUP_SIGNAL_SET, "ER_DUP_SIGNAL_SET", "42000", "" },
        { ER_SIGNAL_WARN, "ER_SIGNAL_WARN", "01000", "" },
        { ER_SIGNAL_NOT_FOUND, "ER_SIGNAL_NOT_FOUND", "02000", "" },
        { ER_SIGNAL_EXCEPTION, "ER_SIGNAL_EXCEPTION", "HY000", "" },
        { ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER, "ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER", "0K000", "" },
        { ER_SIGNAL_BAD_CONDITION_TYPE, "ER_SIGNAL_BAD_CONDITION_TYPE", "", "" },
        { WARN_COND_ITEM_TRUNCATED, "WARN_COND_ITEM_TRUNCATED", "", "" },
        { ER_COND_ITEM_TOO_LONG, "ER_COND_ITEM_TOO_LONG", "", "" },
        { ER_UNKNOWN_LOCALE, "ER_UNKNOWN_LOCALE", "", "" },
        { ER_SLAVE_IGNORE_SERVER_IDS, "ER_SLAVE_IGNORE_SERVER_IDS", "", "" },
        { ER_QUERY_CACHE_DISABLED, "ER_QUERY_CACHE_DISABLED", "", "" },
        { ER_SAME_NAME_PARTITION_FIELD, "ER_SAME_NAME_PARTITION_FIELD", "", "" },
        { ER_PARTITION_COLUMN_LIST_ERROR, "ER_PARTITION_COLUMN_LIST_ERROR", "", "" },
        { ER_WRONG_TYPE_COLUMN_VALUE_ERROR, "ER_WRONG_TYPE_COLUMN_VALUE_ERROR", "", "" },
        { ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR, "ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR", "", "" },
        { ER_MAXVALUE_IN_VALUES_IN, "ER_MAXVALUE_IN_VALUES_IN", "", "" },
        { ER_TOO_MANY_VALUES_ERROR, "ER_TOO_MANY_VALUES_ERROR", "", "" },
        { ER_ROW_SINGLE_PARTITION_FIELD_ERROR, "ER_ROW_SINGLE_PARTITION_FIELD_ERROR", "", "" },
        { ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD, "ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD", "", "" },
        { ER_PARTITION_FIELDS_TOO_LONG, "ER_PARTITION_FIELDS_TOO_LONG", "", "" },
        { ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE, "ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE", "", "" },
        { ER_BINLOG_ROW_MODE_AND_STMT_ENGINE, "ER_BINLOG_ROW_MODE_AND_STMT_ENGINE", "", "" },
        { ER_BINLOG_UNSAFE_AND_STMT_ENGINE, "ER_BINLOG_UNSAFE_AND_STMT_ENGINE", "", "" },
        { ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE, "ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE", "", "" },
        { ER_BINLOG_STMT_MODE_AND_ROW_ENGINE, "ER_BINLOG_STMT_MODE_AND_ROW_ENGINE", "", "" },
        { ER_BINLOG_ROW_INJECTION_AND_STMT_MODE, "ER_BINLOG_ROW_INJECTION_AND_STMT_MODE", "", "" },
        { ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE, "ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE", "", "" },
        { ER_BINLOG_UNSAFE_LIMIT, "ER_BINLOG_UNSAFE_LIMIT", "", "" },
        { ER_BINLOG_UNSAFE_INSERT_DELAYED, "ER_BINLOG_UNSAFE_INSERT_DELAYED", "", "" },
        { ER_BINLOG_UNSAFE_SYSTEM_TABLE, "ER_BINLOG_UNSAFE_SYSTEM_TABLE", "", "" },
        { ER_BINLOG_UNSAFE_AUTOINC_COLUMNS, "ER_BINLOG_UNSAFE_AUTOINC_COLUMNS", "", "" },
        { ER_BINLOG_UNSAFE_UDF, "ER_BINLOG_UNSAFE_UDF", "", "" },
        { ER_BINLOG_UNSAFE_SYSTEM_VARIABLE, "ER_BINLOG_UNSAFE_SYSTEM_VARIABLE", "", "" },
        { ER_BINLOG_UNSAFE_SYSTEM_FUNCTION, "ER_BINLOG_UNSAFE_SYSTEM_FUNCTION", "", "" },
        { ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS, "ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS", "", "" },
        { ER_MESSAGE_AND_STATEMENT, "ER_MESSAGE_AND_STATEMENT", "", "" },
        { ER_SLAVE_CONVERSION_FAILED, "ER_SLAVE_CONVERSION_FAILED", "", "" },
        { ER_SLAVE_CANT_CREATE_CONVERSION, "ER_SLAVE_CANT_CREATE_CONVERSION", "", "" },
        { ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT, "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT", "", "" },
        { ER_PATH_LENGTH, "ER_PATH_LENGTH", "", "" },
        { ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT, "ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT", "", "" },
        { ER_WRONG_NATIVE_TABLE_STRUCTURE, "ER_WRONG_NATIVE_TABLE_STRUCTURE", "", "" },
        { ER_WRONG_PERFSCHEMA_USAGE, "ER_WRONG_PERFSCHEMA_USAGE", "", "" },
        { ER_WARN_I_S_SKIPPED_TABLE, "ER_WARN_I_S_SKIPPED_TABLE", "", "" },
        { ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT, "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT", "", "" },
        { ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT, "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT", "", "" },
        { ER_SPATIAL_MUST_HAVE_GEOM_COL, "ER_SPATIAL_MUST_HAVE_GEOM_COL", "42000", "" },
        { ER_TOO_LONG_INDEX_COMMENT, "ER_TOO_LONG_INDEX_COMMENT", "", "" },
        { ER_LOCK_ABORTED, "ER_LOCK_ABORTED", "", "" },
        { ER_DATA_OUT_OF_RANGE, "ER_DATA_OUT_OF_RANGE", "22003", "" },
        { ER_WRONG_SPVAR_TYPE_IN_LIMIT, "ER_WRONG_SPVAR_TYPE_IN_LIMIT", "", "" },
        { ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE, "ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE", "", "" },
        { ER_BINLOG_UNSAFE_MIXED_STATEMENT, "ER_BINLOG_UNSAFE_MIXED_STATEMENT", "", "" },
        { ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN, "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN", "", "" },
        { ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN, "ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN", "", "" },
        { ER_FAILED_READ_FROM_PAR_FILE, "ER_FAILED_READ_FROM_PAR_FILE", "", "" },
        { ER_VALUES_IS_NOT_INT_TYPE_ERROR, "ER_VALUES_IS_NOT_INT_TYPE_ERROR", "", "" },
        { ER_ACCESS_DENIED_NO_PASSWORD_ERROR, "ER_ACCESS_DENIED_NO_PASSWORD_ERROR", "28000", "" },
        { ER_SET_PASSWORD_AUTH_PLUGIN, "ER_SET_PASSWORD_AUTH_PLUGIN", "", "" },
        { ER_GRANT_PLUGIN_USER_EXISTS, "ER_GRANT_PLUGIN_USER_EXISTS", "", "" },
        { ER_TRUNCATE_ILLEGAL_FK, "ER_TRUNCATE_ILLEGAL_FK", "42000", "" },
        { ER_PLUGIN_IS_PERMANENT, "ER_PLUGIN_IS_PERMANENT", "", "" },
        { ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN, "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN", "", "" },
        { ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX, "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX", "", "" },
        { ER_STMT_CACHE_FULL, "ER_STMT_CACHE_FULL", "", "" },
        { ER_MULTI_UPDATE_KEY_CONFLICT, "ER_MULTI_UPDATE_KEY_CONFLICT", "", "" },
        { ER_TABLE_NEEDS_REBUILD, "ER_TABLE_NEEDS_REBUILD", "", "" },
        { WARN_OPTION_BELOW_LIMIT, "WARN_OPTION_BELOW_LIMIT", "", "" },
        { ER_INDEX_COLUMN_TOO_LONG, "ER_INDEX_COLUMN_TOO_LONG", "", "" },
        { ER_ERROR_IN_TRIGGER_BODY, "ER_ERROR_IN_TRIGGER_BODY", "", "" },
        { ER_ERROR_IN_UNKNOWN_TRIGGER_BODY, "ER_ERROR_IN_UNKNOWN_TRIGGER_BODY", "", "" },
        { ER_INDEX_CORRUPT, "ER_INDEX_CORRUPT", "", "" },
        { ER_UNDO_RECORD_TOO_BIG, "ER_UNDO_RECORD_TOO_BIG", "", "" },
        { ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT, "ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT", "", "" },
        { ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE, "ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE", "", "" },
        { ER_BINLOG_UNSAFE_REPLACE_SELECT, "ER_BINLOG_UNSAFE_REPLACE_SELECT", "", "" },
        { ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT, "ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT", "", "" },
        { ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT, "ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT", "", "" },
        { ER_BINLOG_UNSAFE_UPDATE_IGNORE, "ER_BINLOG_UNSAFE_UPDATE_IGNORE", "", "" },
        { ER_PLUGIN_NO_UNINSTALL, "ER_PLUGIN_NO_UNINSTALL", "", "" },
        { ER_PLUGIN_NO_INSTALL, "ER_PLUGIN_NO_INSTALL", "", "" },
        { ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT, "ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT", "", "" },
        { ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC, "ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC", "", "" },
        { ER_BINLOG_UNSAFE_INSERT_TWO_KEYS, "ER_BINLOG_UNSAFE_INSERT_TWO_KEYS", "", "" },
        { ER_TABLE_IN_FK_CHECK, "ER_TABLE_IN_FK_CHECK", "", "" },
        { ER_UNSUPPORTED_ENGINE, "ER_UNSUPPORTED_ENGINE", "", "" },
        { ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST, "ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST", "", "" },
        { ER_CANNOT_LOAD_FROM_TABLE_V2, "ER_CANNOT_LOAD_FROM_TABLE_V2", "", "" },
        { ER_MASTER_DELAY_VALUE_OUT_OF_RANGE, "ER_MASTER_DELAY_VALUE_OUT_OF_RANGE", "", "" },
        { ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT, "ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT", "", "" },
        { ER_PARTITION_EXCHANGE_DIFFERENT_OPTION, "ER_PARTITION_EXCHANGE_DIFFERENT_OPTION", "", "" },
        { ER_PARTITION_EXCHANGE_PART_TABLE, "ER_PARTITION_EXCHANGE_PART_TABLE", "", "" },
        { ER_PARTITION_EXCHANGE_TEMP_TABLE, "ER_PARTITION_EXCHANGE_TEMP_TABLE", "", "" },
        { ER_PARTITION_INSTEAD_OF_SUBPARTITION, "ER_PARTITION_INSTEAD_OF_SUBPARTITION", "", "" },
        { ER_UNKNOWN_PARTITION, "ER_UNKNOWN_PARTITION", "", "" },
        { ER_TABLES_DIFFERENT_METADATA, "ER_TABLES_DIFFERENT_METADATA", "", "" },
        { ER_ROW_DOES_NOT_MATCH_PARTITION, "ER_ROW_DOES_NOT_MATCH_PARTITION", "", "" },
        { ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX, "ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX", "", "" },
        { ER_WARN_INDEX_NOT_APPLICABLE, "ER_WARN_INDEX_NOT_APPLICABLE", "", "" },
        { ER_PARTITION_EXCHANGE_FOREIGN_KEY, "ER_PARTITION_EXCHANGE_FOREIGN_KEY", "", "" },
        { ER_NO_SUCH_KEY_VALUE, "ER_NO_SUCH_KEY_VALUE", "", "" },
        { ER_RPL_INFO_DATA_TOO_LONG, "ER_RPL_INFO_DATA_TOO_LONG", "", "" },
        { ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE, "ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE", "", "" },
        { ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE, "ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE", "", "" },
        { ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX, "ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX", "", "" },
        { ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT, "ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT", "", "" },
        { ER_PARTITION_CLAUSE_ON_NONPARTITIONED, "ER_PARTITION_CLAUSE_ON_NONPARTITIONED", "", "" },
        { ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET, "ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET", "", "" },
        { ER_NO_SUCH_PARTITION__UNUSED, "ER_NO_SUCH_PARTITION__UNUSED", "", "" },
        { ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE, "ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE", "", "" },
        { ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE, "ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE", "", "" },
        { ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE, "ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE", "", "" },
        { ER_MTS_FEATURE_IS_NOT_SUPPORTED, "ER_MTS_FEATURE_IS_NOT_SUPPORTED", "", "" },
        { ER_MTS_UPDATED_DBS_GREATER_MAX, "ER_MTS_UPDATED_DBS_GREATER_MAX", "", "" },
        { ER_MTS_CANT_PARALLEL, "ER_MTS_CANT_PARALLEL", "", "" },
        { ER_MTS_INCONSISTENT_DATA, "ER_MTS_INCONSISTENT_DATA", "", "" },
        { ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING, "ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING", "", "" },
        { ER_DA_INVALID_CONDITION_NUMBER, "ER_DA_INVALID_CONDITION_NUMBER", "35000", "" },
        { ER_INSECURE_PLAIN_TEXT, "ER_INSECURE_PLAIN_TEXT", "", "" },
        { ER_INSECURE_CHANGE_MASTER, "ER_INSECURE_CHANGE_MASTER", "", "" },
        { ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO, "ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO", "", "" },
        { ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO, "ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO", "", "" },
        { ER_SQLTHREAD_WITH_SECURE_SLAVE, "ER_SQLTHREAD_WITH_SECURE_SLAVE", "", "" },
        { ER_TABLE_HAS_NO_FT, "ER_TABLE_HAS_NO_FT", "", "" },
        { ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER, "ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER", "", "" },
        { ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION, "ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION", "", "" },
        { ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST, "ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST", "", "" },
        { ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL, "ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL", "", "" },
        { ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION, "ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION", "", "" },
        { ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL, "ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL", "", "" },
        { ER_SKIPPING_LOGGED_TRANSACTION, "ER_SKIPPING_LOGGED_TRANSACTION", "", "" },
        { ER_MALFORMED_GTID_SET_SPECIFICATION, "ER_MALFORMED_GTID_SET_SPECIFICATION", "", "" },
        { ER_MALFORMED_GTID_SET_ENCODING, "ER_MALFORMED_GTID_SET_ENCODING", "", "" },
        { ER_MALFORMED_GTID_SPECIFICATION, "ER_MALFORMED_GTID_SPECIFICATION", "", "" },
        { ER_GNO_EXHAUSTED, "ER_GNO_EXHAUSTED", "", "" },
        { ER_BAD_SLAVE_AUTO_POSITION, "ER_BAD_SLAVE_AUTO_POSITION", "", "" },
        { ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON, "ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON", "", "" },
        { ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET, "ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET", "", "" },
        { ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON, "ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON", "", "" },
        { ER_GTID_MODE_REQUIRES_BINLOG, "ER_GTID_MODE_REQUIRES_BINLOG", "", "" },
        { ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF, "ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF", "", "" },
        { ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON, "ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON", "", "" },
        { ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF, "ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF", "", "" },
        { ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF, "ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF", "", "" },
        { ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE, "ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE", "", "" },
        { ER_GTID_UNSAFE_CREATE_SELECT, "ER_GTID_UNSAFE_CREATE_SELECT", "", "" },
        { ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION, "ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION", "", "" },
        { ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME, "ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME", "", "" },
        { ER_MASTER_HAS_PURGED_REQUIRED_GTIDS, "ER_MASTER_HAS_PURGED_REQUIRED_GTIDS", "", "" },
        { ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID, "ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID", "", "" },
        { ER_UNKNOWN_EXPLAIN_FORMAT, "ER_UNKNOWN_EXPLAIN_FORMAT", "", "" },
        { ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION, "ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION", "", "" },
        { ER_TOO_LONG_TABLE_PARTITION_COMMENT, "ER_TOO_LONG_TABLE_PARTITION_COMMENT", "", "" },
        { ER_SLAVE_CONFIGURATION, "ER_SLAVE_CONFIGURATION", "", "" },
        { ER_INNODB_FT_LIMIT, "ER_INNODB_FT_LIMIT", "", "" },
        { ER_INNODB_NO_FT_TEMP_TABLE, "ER_INNODB_NO_FT_TEMP_TABLE", "", "" },
        { ER_INNODB_FT_WRONG_DOCID_COLUMN, "ER_INNODB_FT_WRONG_DOCID_COLUMN", "", "" },
        { ER_INNODB_FT_WRONG_DOCID_INDEX, "ER_INNODB_FT_WRONG_DOCID_INDEX", "", "" },
        { ER_INNODB_ONLINE_LOG_TOO_BIG, "ER_INNODB_ONLINE_LOG_TOO_BIG", "", "" },
        { ER_UNKNOWN_ALTER_ALGORITHM, "ER_UNKNOWN_ALTER_ALGORITHM", "", "" },
        { ER_UNKNOWN_ALTER_LOCK, "ER_UNKNOWN_ALTER_LOCK", "", "" },
        { ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS, "ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS", "", "" },
        { ER_MTS_RECOVERY_FAILURE, "ER_MTS_RECOVERY_FAILURE", "", "" },
        { ER_MTS_RESET_WORKERS, "ER_MTS_RESET_WORKERS", "", "" },
        { ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2, "ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2", "", "" },
        { ER_SLAVE_SILENT_RETRY_TRANSACTION, "ER_SLAVE_SILENT_RETRY_TRANSACTION", "", "" },
        { ER_DISCARD_FK_CHECKS_RUNNING, "ER_DISCARD_FK_CHECKS_RUNNING", "", "" },
        { ER_TABLE_SCHEMA_MISMATCH, "ER_TABLE_SCHEMA_MISMATCH", "", "" },
        { ER_TABLE_IN_SYSTEM_TABLESPACE, "ER_TABLE_IN_SYSTEM_TABLESPACE", "", "" },
        { ER_IO_READ_ERROR, "ER_IO_READ_ERROR", "", "" },
        { ER_IO_WRITE_ERROR, "ER_IO_WRITE_ERROR", "", "" },
        { ER_TABLESPACE_MISSING, "ER_TABLESPACE_MISSING", "", "" },
        { ER_TABLESPACE_EXISTS, "ER_TABLESPACE_EXISTS", "", "" },
        { ER_TABLESPACE_DISCARDED, "ER_TABLESPACE_DISCARDED", "", "" },
        { ER_INTERNAL_ERROR, "ER_INTERNAL_ERROR", "", "" },
        { ER_INNODB_IMPORT_ERROR, "ER_INNODB_IMPORT_ERROR", "", "" },
        { ER_INNODB_INDEX_CORRUPT, "ER_INNODB_INDEX_CORRUPT", "", "" },
        { ER_INVALID_YEAR_COLUMN_LENGTH, "ER_INVALID_YEAR_COLUMN_LENGTH", "", "" },
        { ER_NOT_VALID_PASSWORD, "ER_NOT_VALID_PASSWORD", "", "" },
        { ER_MUST_CHANGE_PASSWORD, "ER_MUST_CHANGE_PASSWORD", "", "" },
        { ER_FK_NO_INDEX_CHILD, "ER_FK_NO_INDEX_CHILD", "", "" },
        { ER_FK_NO_INDEX_PARENT, "ER_FK_NO_INDEX_PARENT", "", "" },
        { ER_FK_FAIL_ADD_SYSTEM, "ER_FK_FAIL_ADD_SYSTEM", "", "" },
        { ER_FK_CANNOT_OPEN_PARENT, "ER_FK_CANNOT_OPEN_PARENT", "", "" },
        { ER_FK_INCORRECT_OPTION, "ER_FK_INCORRECT_OPTION", "", "" },
        { ER_FK_DUP_NAME, "ER_FK_DUP_NAME", "", "" },
        { ER_PASSWORD_FORMAT, "ER_PASSWORD_FORMAT", "", "" },
        { ER_FK_COLUMN_CANNOT_DROP, "ER_FK_COLUMN_CANNOT_DROP", "", "" },
        { ER_FK_COLUMN_CANNOT_DROP_CHILD, "ER_FK_COLUMN_CANNOT_DROP_CHILD", "", "" },
        { ER_FK_COLUMN_NOT_NULL, "ER_FK_COLUMN_NOT_NULL", "", "" },
        { ER_DUP_INDEX, "ER_DUP_INDEX", "", "" },
        { ER_FK_COLUMN_CANNOT_CHANGE, "ER_FK_COLUMN_CANNOT_CHANGE", "", "" },
        { ER_FK_COLUMN_CANNOT_CHANGE_CHILD, "ER_FK_COLUMN_CANNOT_CHANGE_CHILD", "", "" },
        { ER_FK_CANNOT_DELETE_PARENT, "ER_FK_CANNOT_DELETE_PARENT", "", "" },
        { ER_MALFORMED_PACKET, "ER_MALFORMED_PACKET", "", "" },
        { ER_READ_ONLY_MODE, "ER_READ_ONLY_MODE", "", "" },
        { ER_GTID_NEXT_TYPE_UNDEFINED_GROUP, "ER_GTID_NEXT_TYPE_UNDEFINED_GROUP", "", "" },
        { ER_VARIABLE_NOT_SETTABLE_IN_SP, "ER_VARIABLE_NOT_SETTABLE_IN_SP", "", "" },
        { ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF, "ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF", "", "" },
        { ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY, "ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY", "", "" },
        { ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY, "ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY", "", "" },
        { ER_GTID_PURGED_WAS_CHANGED, "ER_GTID_PURGED_WAS_CHANGED", "", "" },
        { ER_GTID_EXECUTED_WAS_CHANGED, "ER_GTID_EXECUTED_WAS_CHANGED", "", "" },
        { ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES, "ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED, "ER_ALTER_OPERATION_NOT_SUPPORTED", "0A000", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON", "0A000", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS", "", "" },
        { ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE, "ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE", "", "" },
        { ER_DUP_UNKNOWN_IN_INDEX, "ER_DUP_UNKNOWN_IN_INDEX", "23000", "" },
        { ER_IDENT_CAUSES_TOO_LONG_PATH, "ER_IDENT_CAUSES_TOO_LONG_PATH", "", "" },
        { ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL, "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL", "", "" },
        { ER_MUST_CHANGE_PASSWORD_LOGIN, "ER_MUST_CHANGE_PASSWORD_LOGIN", "", "" },
        { ER_ROW_IN_WRONG_PARTITION, "ER_ROW_IN_WRONG_PARTITION", "", "" },
        { ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX, "ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX", "", "" },
        { ER_INNODB_NO_FT_USES_PARSER, "ER_INNODB_NO_FT_USES_PARSER", "", "" },
        { ER_BINLOG_LOGICAL_CORRUPTION, "ER_BINLOG_LOGICAL_CORRUPTION", "", "" },
        { ER_WARN_PURGE_LOG_IN_USE, "ER_WARN_PURGE_LOG_IN_USE", "", "" },
        { ER_WARN_PURGE_LOG_IS_ACTIVE, "ER_WARN_PURGE_LOG_IS_ACTIVE", "", "" },
        { ER_AUTO_INCREMENT_CONFLICT, "ER_AUTO_INCREMENT_CONFLICT", "", "" },
        { WARN_ON_BLOCKHOLE_IN_RBR, "WARN_ON_BLOCKHOLE_IN_RBR", "", "" },
        { ER_SLAVE_MI_INIT_REPOSITORY, "ER_SLAVE_MI_INIT_REPOSITORY", "", "" },
        { ER_SLAVE_RLI_INIT_REPOSITORY, "ER_SLAVE_RLI_INIT_REPOSITORY", "", "" },
        { ER_ACCESS_DENIED_CHANGE_USER_ERROR, "ER_ACCESS_DENIED_CHANGE_USER_ERROR", "28000", "" },
        { ER_INNODB_READ_ONLY, "ER_INNODB_READ_ONLY", "", "" },
        { ER_STOP_SLAVE_SQL_THREAD_TIMEOUT, "ER_STOP_SLAVE_SQL_THREAD_TIMEOUT", "", "" },
        { ER_STOP_SLAVE_IO_THREAD_TIMEOUT, "ER_STOP_SLAVE_IO_THREAD_TIMEOUT", "", "" },
        { ER_TABLE_CORRUPT, "ER_TABLE_CORRUPT", "", "" },
        { ER_TEMP_FILE_WRITE_FAILURE, "ER_TEMP_FILE_WRITE_FAILURE", "", "" },
        { ER_INNODB_FT_AUX_NOT_HEX_ID, "ER_INNODB_FT_AUX_NOT_HEX_ID", "", "" },
        { ER_OLD_TEMPORALS_UPGRADED, "ER_OLD_TEMPORALS_UPGRADED", "", "" },
        { ER_INNODB_FORCED_RECOVERY, "ER_INNODB_FORCED_RECOVERY", "", "" },
        { ER_ERROR_COMMON, "ER_ERROR_COMMON", "HY000", "" },
        { ER_MAKE_RESULT_PACKET, "ER_MAKE_RESULT_PACKET", "HY000", "" },
        { ER_GEN_PLAN_FAILED, "ER_GEN_PLAN_FAILED", "HY000", "" },
        { ER_EXEC_PLAN_FAILED, "ER_EXEC_PLAN_FAILED", "HY000", "" },
        { ER_QUERY_EXCEED_QUOTA, "ER_QUERY_EXCEED_QUOTA", "HY000", "" },
        { ER_SQL_TOO_BIG, "ER_SQL_TOO_BIG", "HY000", "" },
        { ER_SQL_REFUSE, "ER_SQL_REFUSE", "HY000", "" },
    };
    for (auto& item : mysql_err_item) {
        if (item.state_odbc == "" && item.state_jdbc == "") {
            item.state_odbc = "HY000";
            item.state_jdbc = "";
        }
        _error_mapping[item.err_code] = &item;
    }
    _is_init = true;
    return true;
}

MysqlErrHandler::~MysqlErrHandler() {}

MysqlErrorItem* MysqlErrHandler::get_error_item_by_code(MysqlErrCode code) {
    if (_error_mapping.count(code) == 0) {
        return nullptr;
    }
    return _error_mapping[code];
}
} // end of namespace baikal
